#include<stdio.h>

int main()
{
    double eps;
    scanf("%lf", &eps);
    double s = 0.0, i = 1.0, k = 1.0;
    for (i = 1.0; (1 / (3 * i - 2)) > eps; i++)
    {
        s += k / (3 * i - 2);
        k = -k;
    }
    s += k / (3 * i - 2);
    printf("sum = %.6f", s);

    return 0;
}